package com.nb.demo.kafka.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.config.KafkaListenerContainerFactory;
import org.springframework.kafka.support.Acknowledgment;
import org.springframework.stereotype.Component;

/**
 * @Description: java类作用描述
 * @Author: hiven
 * @CreateDate: 2019/11/30$ 17:39$
 * @UpdateUser: yc
 * @UpdateDate: 2019/11/30$ 17:39$
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Component
public class TestKafkaListener {

    @KafkaListener(topics = "testTopic",containerFactory = "batchContainerFactory")
    public void processMessage(String content, Acknowledgment ack) {
        System.out.println("消息被消费: "+content);
        //ack.acknowledge();

    }
}
